export default {
    namespaced: true,
    state: {
        myself: {},
        opponent: {},
        problemId: null,
        websocket: null,
    },
    getters: {
        myself: (state) => state.myself,
        opponent: (state) => state.opponent,
        problemId: (state) => state.problemId,
        websocket: (state) => state.websocket,
    },
    actions: {
        setMyself ({commit}, myself) {
            console.log(myself)
            commit('setMyself', myself);
        },
        setOpponent ({commit}, opponent) {
            commit('setOpponent', opponent);
        },
        setProblemId ({commit}, problemId) {
            commit('setProblemId', problemId);
        },
        setWebsocket ({commit}, websocket) {
            commit('setWebsocket', websocket);
        },
    },
    mutations: {
        setMyself (state, myself) {
            state.myself = myself
        },
        setOpponent (state, opponent) {
            state.opponent = opponent
        },
        setProblemId (state, problemId) {
            state.problemId = problemId
        },
        setWebsocket (state, websocket) {
            state.websocket = websocket
        }
    },
}
